import * as HttpServices from "@/utils/HttpServices";
import { getLoginPayload } from "@/utils/server";
import { Message, MessageBox } from "element-ui";
import { getMenuID, param } from "@/utils/index";
const searchQuery = {
  rows: 100,
  pages: 1
};
export default {
  namespaced: true,
  state: {},
  mutations: {},
  actions: {
    async exportData({}, params) {
      console.log("exportData params111=", params);
      const payload = getLoginPayload("hhe309081", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode == 1) {
        Message({
          type: "success",
          message: "导出数据成功，请在文件列表中查看。"
        });
      }
      return res;
    },
    // 获取物资列表数据
    async getGoodsData({ dispatch, commit, state }, params) {
      state.pageLoading = true;
      const body = {
        status: 1,
        auditStatus: 1,
        ...params,
        ...searchQuery,
        rows: 100
      };
      const payload = getLoginPayload("hhe215014", body); //原 hhe215011
      const res = await HttpServices.startApiReq(payload);
      if (
        res.msgcode === 1 &&
        res.resultdata &&
        res.resultdata.data.length > 0
      ) {
        state.pageLoading = false;
        const list = [];
        const grossWeight = {};
        res.resultdata.data.map(item => {
          // 筛选只启用的数据
          if (item.status && item.status.value == 1) {
            item.id = item.coefficientCode;
            item.name = item.coefficientCode;
            list.push(item);
            grossWeight[item.coefficientCode] = item.grossWeight;
          }
        });
        list.__proto__.gross = grossWeight; // 毛重随物资列表一起带出
        return list;
      } else {
        state.pageLoading = false;
        return [];
      }
    },
    // 获取大类数据
    async getCategoryData({ dispatch, commit }, name = "") {
      const body = {
        status: 1,
        category: name,
        ...searchQuery
      };
      const payload = getLoginPayload("hhe210011", body);
      const res = await HttpServices.startApiReq(payload);
      if (
        res.msgcode === 1 &&
        res.resultdata &&
        res.resultdata.data.length > 0
      ) {
        const list = [];
        res.resultdata.data.map(item => {
          list.push({
            ...item,
            id: item.id,
            name: item.category
          });
        });
        return list;
      } else {
        return [];
      }
    },
    //获取采购控制类别设置
    async getPriceTypeName({ state, commit }, params) {
      const payload = getLoginPayload("hhb366011", { ...params, status: 1 });
      const res = await HttpServices.startApiReq(payload);
      console.log("getProvince", res);
      if (res.msgcode == 1) {
        return res.resultdata && res.resultdata.data;
      }
    },
    async getProvince({ state, commit }, params) {
      const payload = getLoginPayload("hhe227011", params);
      const res = await HttpServices.startApiReq(payload);
      console.log("getProvince", res);
      if (res.msgcode == 1) {
        return res.resultdata && res.resultdata.data;
      }
    },
    //区域带通用
    async getProvinceT({ state, commit }, params) {
      const payload = getLoginPayload("hhe227016", params);
      const res = await HttpServices.startApiReq(payload);
      console.log("getProvince", res);
      if (res.msgcode == 1) {
        return res.resultdata && res.resultdata;
      }
    },
    // 获取采购到票状态
    async getInvoiceStatusData({ dispatch, commit }, params) {
      const body = {
        searchType: 1,
        pages:1,
        rows:9999,
        fields:[{"name":" dictName","operation":"包含","value":"到票状态"}],
        noFilters:"",
        noFilters2:"",
        sortables:[{"name":"sort","order":"asc"}]
      };
      const payload = getLoginPayload("hhe221011", body);
      const res = await HttpServices.startApiReq(payload);
      if (
        res.msgcode === 1 &&
        res.resultdata &&
        res.resultdata.data.length > 0
      ) {
        const list = res.resultdata.data;
        return list;
      } else {
        return [];
      }
    },
    // 获取品名数据
    async getProductNameData({ dispatch, commit }, params) {
      const { name = "", pid = "", status } = params || {};
      const body = {
        ...params,
        status: 1,
        product: name,
        pid,
        ...searchQuery
      };
      console.log("basedata request getProductNameData body=", body);
      const payload = getLoginPayload("hhe211011", body);
      const res = await HttpServices.startApiReq(payload);
      if (
        res.msgcode === 1 &&
        res.resultdata &&
        res.resultdata.data.length > 0
      ) {
        const list = [];
        res.resultdata.data.map(item => {
          list.push({
            ...item,
            id: item.id,
            name: item.product
          });
        });
        return list;
      } else {
        return [];
      }
    },
    // 获取材质数据
    async getMaterialData({ dispatch, commit }, params) {
      const { name = "", pid = "", status = "1", product = "" } = params || {};
      const body = {
        material: name,
        pid,
        product,
        status,
        ...searchQuery
      };
      console.log("basedata request getMaterialData body=", body);
      const payload = getLoginPayload("hhe212011", body);
      const res = await HttpServices.startApiReq(payload);
      if (
        res.msgcode === 1 &&
        res.resultdata &&
        res.resultdata.data.length > 0
      ) {
        const list = [];
        res.resultdata.data.map(item => {
          list.push({
            ...item,
            id: item.id,
            name: item.material
          });
        });
        return list;
      } else {
        return [];
      }
    },
    // 获取规格数据
    async getSpecificationsData({ dispatch, commit }, params) {
      const { name = "", pid = "", status = "1", product = "" } = params || {};
      const body = {
        specifications: name,
        pid,
        product,
        status,
        ...searchQuery
      };
      console.log("basedata request getSpecificationsData body=", body);
      const payload = getLoginPayload("hhe213011", body);
      const res = await HttpServices.startApiReq(payload);
      if (
        res.msgcode === 1 &&
        res.resultdata &&
        res.resultdata.data.length > 0
      ) {
        const list = [];
        res.resultdata.data.map(item => {
          list.push({
            ...item,
            id: item.id,
            name: item.specifications
          });
        });
        return list;
      } else {
        return [];
      }
    },
    // 获取厂家数据
    async getOriginPlaceData({ dispatch, commit }, params = {}) {
      const { name = "", pid = "", status = "1", product = "" } = params || {};
      const body = {
        origin: name,
        pid,
        status,
        ...searchQuery
      };
      if (product) body.product = product;
      const payload = getLoginPayload("hhe214011", body);
      const res = await HttpServices.startApiReq(payload);
      if (
        res.msgcode === 1 &&
        res.resultdata &&
        res.resultdata.data.length > 0
      ) {
        const list = [];
        res.resultdata.data.map(item => {
          list.push({
            ...item,
            id: item.id,
            name: item.origin
          });
        });
        return list;
      } else {
        return [];
      }
    },
    // 通过机构和当前登陆人，查询当前登录人在机构下的部门xyh100116
    async getDepData({ rootGetters, state, commit }, params = {}) {
      const payload = getLoginPayload("xyh100116", {
        menuId: getMenuID(),
        userId: rootGetters.userInfo.userid,
        systemID: rootGetters.currentSystemID,
        ...params
      });
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        return res;
      }
    },
    // 获取机构列表
    async getOrgsData({ rootGetters, state, commit }, params = {}) {
      // use804021  20220523换成了use001050
      // 不用use001050  java 那边要做权限控制
      const payload = getLoginPayload("hhe216092", {
        menuId: getMenuID(),
        userId: rootGetters.userInfo.userid,
        systemID: rootGetters.currentSystemID,
        ...params
      });
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const units = res.resultdata;
        const list =
          units &&
          units.map(item => {
            // 组织单位下的部门数据
            const departs =
              item.Units &&
              item.Units.map(i => {
                const depart = { id: i.ID, name: i.UnitName, code: i.UnitCode };
                return depart;
              });
            return {
              ...item,
              id: item.ID,
              name: item.OrgName,
              enterpName: item.EnterpName,
              code: item.OrgCode,
              userLevel: item.userLevel, // 用户级别，为3时需控制业务员不能选，默认当前登录用户
              departs: departs
            };
          });
        return list;
      } else {
        return [];
      }
    },
    // 获取业务员列表
    async getSalemanData({ rootGetters, state }, params = {}) {
      if (!params.noAuth && params.noAuth != false) {
        // 若没有值， 默认传false；
        params.noAuth = true;
      }
      params = {
        menuId: getMenuID(),
        userId: rootGetters.userInfo.userid,
        systemID: rootGetters.currentSystemID,
        pages: 1,
        rows: 100,
        ...params
      };
      let code = "use804022";
      // use804022 去掉  hhbyw-8272 去掉不行，hhe216093接口不关联机构部门
      const payload = getLoginPayload(code, params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const datas = res.resultdata;
        const list =
          datas &&
          datas.map(item => {
            return {
              // 运营经理使用的，后台需要这个字段当作userCode
              userName: item.UserName,
              id: item.ID,
              name: item.RealName,
              MobliePhone: item.MobliePhone
            };
          });
        return list;
      } else {
        return [];
      }
    },
    // 获取内部项目
    async getInternalBuyerUnit({ state, commit, rootGetters }, params) {
      const code = "hhe226016";

      const userInfo = rootGetters.userInfo;
      params = {
        // status: 1,
        // auditStatus: 1,
        //  userId: userInfo.userid,
        isOnlineHh: 1,
        // systemID: rootGetters.currentSystemID,
        pages: 1,
        rows: 100, //改采销黑名单的时候 请求条数 改成100
        ...params
        //    buySellBlacklist: 1
      };

      const payload = getLoginPayload(code, params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        return res.resultdata?.resultData;
      } else {
        return [];
      }
    },
    // 获取往来单位：下游买家、上游卖家等
    async getBuyerUnit({ state, commit, rootGetters }, params) {
      const code =
        params?.nofilterUnit && params?.nofilterUnit == true
          ? "hhe226011"
          : "hhe226013";
      const userInfo = rootGetters.userInfo;
      params = {
        status: 1,
        auditStatus: 1,
        userId: userInfo.userid,
        systemID: rootGetters.currentSystemID,
        pages: 1,
        rows: 100, //改采销黑名单的时候 请求条数 改成100
        ...params,
        buySellBlacklist: code == "hhe226013" ? 2 : 1
      };

      const payload = getLoginPayload(code, params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            if (item.buySellBlacklist == 2) {
              item.unitName = item.unitName + "(黑名单)";
              item.disabled = true;
            }
            return item;
          });
        return list;
      } else {
        return [];
      }
    },
    // 获取整个项目列表
    async getProjectList({ state, commit }, params) {
      params = {
        status: 1,
        auditStatus: 1,
        pages: 1,
        rows: 100,
        ...params
      };
      const payload = getLoginPayload("hhe228011", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        return (
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            item.name = item.projectName;
            return item;
          })
        );
      } else {
        return [];
      }
    },
    // 获取往来单位id联动查询项目列表
    async getCompanyProjectList({ state, commit }, params) {
      params = {
        //hhbyw-7894
        status: 1,
        auditStatus: 1,
        ...params,
        projectName: params.projectName
          ? params.projectName
          : params.unitName
          ? params.unitName
          : ""
      };
      delete params.unitName;
      const payload = getLoginPayload("hhe229013", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        return (
          res.resultdata &&
          res.resultdata.map(item => {
            item.id = item.projectId;
            item.name = item.projectName;
            return item;
          })
        );
      } else {
        return [];
      }
    },
    // 获取账号列表 跟着 往来单位 hhe303013
    async getCompanyAccount({ state, commit }, params) {
      const payload = getLoginPayload("hhe303013", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        return (
          res.resultdata &&
          res.resultdata.map(item => {
            item.id = item.accountId;
            item.name = item.account + " " + item.bankBranchName;
            return item;
          })
        );
      } else {
        return [];
      }
    },
    // 获取签收人:获取当前下游买家下联系人主数据
    async getSignPerson({ state, commit }, params) {
      const payload = getLoginPayload("hhe300011", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            return { id: item.id, name: item.contactName };
          });
        return list;
      } else {
        return [];
      }
    },
    // 获取联系人 与买家单位 联动
    async getCompanyPerson({ state, commit }, params) {
      const payload = getLoginPayload("hhe301013", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata &&
          res.resultdata.map(item => {
            return {
              id: item.contactId,
              name: item.contactName,
              mobilePhone: item.mobilePhone
            };
          });
        return list;
      } else {
        return [];
      }
    },

    // 获取仓库列表
    async getWarehouses({ state, commit, rootGetters }, params) {
      if (!params.enterpriseCode) {
        // 若没传机构  则用默认机构
        // isUnitName 如果跟着供方走，就不能传机构
        params.enterpriseCode = params.isUnitName
          ? ""
          : rootGetters.userInfo.defaultEnterpriseCode;
      }
      params = {
        pages: 1,
        rows: 500,
        ...params
      };
      //  是否要查询机构下面的仓库

      const payload = getLoginPayload("hhe225011", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            return {
              id: item.warehouseId,
              name: item.warehouseName,
              code: item.warehouseCode,
              typeId: item.typeId,
              ckdz: [
                item.warehouseProvince,
                item.warehouseCity,
                item.warehouseArea,
                item.warehouseAddress
              ],
              enterpriseCode: item.enterpriseCode
            };
          });
        return list;
      } else {
        return [];
      }
    },

    // 获取所有仓库列表
    async getAllWarehouses({ state, commit, rootGetters }, params) {
      params = {
        pages: 1,
        rows: 500,
        ...params
      };
      //  是否要查询机构下面的仓库
      const payload = getLoginPayload("hhe222011", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            return {
              id: item.warehouseId || item.id,
              name: item.warehouseName,
              code: item.warehouseCode,
              typeId: item.typeId.value,
              ckdz: [
                item.warehouseProvince,
                item.warehouseCity,
                item.warehouseArea,
                item.warehouseAddress
              ]
            };
          });
        return list;
      } else {
        return [];
      }
    },

    // 获取需要记账标识的仓库列表
    async getShowFeeFlagWarehouses({ state, commit, rootGetters }, params) {
      if (!params.enterpriseCode) {
        // 若没传机构  则用默认机构
        // isUnitName 如果跟着供方走，就不能传机构
        params.enterpriseCode = params.isUnitName
          ? ""
          : rootGetters.userInfo.defaultEnterpriseCode;
      }
      params = {
        pages: 1,
        rows: 500,
        ...params
      };

      const payload = getLoginPayload("hhb600398", params);
      const res = await HttpServices.startApiReq(payload);
      console.log("1111-res", res);
      if (res.msgcode === 1) {
        const list =
          res.resultdata &&
          res.resultdata.map(item => {
            return {
              id: item.warehouseId,
              name: item.warehouseName,
              code: item.warehouseCode,
              enterpriseCode: item.enterpriseCode
            };
          });
        return list;
      } else {
        return [];
      }
    },

    // 获取库位列表
    async getLocation({ state, commit }, params) {
      params = {
        pages: 1,
        rows: 100,
        ...params
      };
      const payload = getLoginPayload("hhe224011", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            return { id: item.id, name: item.locationName };
          });
        return list;
      } else {
        return [];
      }
    },
    // 获取计量单位排序数据
    async getMeasurementUnitList({ rootGetters }) {
      const uid = rootGetters.userInfo.user_id;
      const res = await api.startReq(
        "base/getUserMaterialMeasurementUnitList",
        { uid },
        "get"
      );
      return res;
    },
    // 获取计量单位排序数据
    async getMeasurementMethodList({ rootGetters }) {
      const uid = rootGetters.userInfo.user_id;
      const res = await api.startReq(
        "base/getUserMaterialMeasurementMethodList",
        { uid },
        "get"
      );
      return res;
    },
    // 获取资金部分的账号列表（转入账号，转出账号）
    async getAccountNoLists({ state, commit }, params) {
      const payload = getLoginPayload("hhe302011", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            return {
              id: item.id,
              account: item.account,
              // isDefault: item.isDefault?.value,
              name: item.accountName,
              label: item.account + " " + item.accountName
            };
          });
        return list;
      } else {
        return [];
      }
    },
    // 获取资金部分的账号列表（转入账号，转出账号）
    async getAccountNoList({ state, commit }, params) {
      const payload = getLoginPayload("hhe312011", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            return {
              id: item.id,
              account: item.accountNo,
              isDefault: item.isDefault?.value,
              name: item.openBankName,
              label: item.accountNo + " " + item.openBankName
            };
          });
        return list;
      } else {
        return [];
      }
    },
    // 根据关联的单位 来获取对应的账户
    async getAccountNoListByCompany({ state, commit }, params) {
      const payload = getLoginPayload("hhe303013", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata &&
          res.resultdata.map(item => {
            return {
              id: item.accountId,
              account: item.account,
              isDefault: item.major?.value,
              name: item.bankBranchName,
              label: item.account + " " + item.bankBranchName
            };
          });
        return list;
      } else {
        return [];
      }
    },
    // 获取结算周期列表
    async getPurchaseCycleList({}, params) {
      const payload = getLoginPayload("hhb350011", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            // 转成字符串便于下拉框匹配
            return {
              id: String(item.id),
              name: item.settingName
            };
          });
        return list;
      } else {
        return [];
      }
    },
    // 获取定价周期列表
    async getPriceCycleList({}, params) {
      const payload = getLoginPayload("hhb353011", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list =
          res.resultdata.data &&
          res.resultdata.data.map(item => {
            // 转成字符串便于下拉框匹配
            return {
              id: String(item.id),
              name: item.settingName,
              orderNo: item.orderNo
            };
          });
        return list;
      } else {
        return [];
      }
    },
    // 根据定价周期计算起始日期、结束日期
    async getWeekDate({}, params) {
      const payload = getLoginPayload("hhb353092", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list = res.resultdata;
        return list;
      } else {
        return [];
      }
    },
    // 根据机构查钢厂
    async getSteelList({ state, commit }, params) {
      const payload = getLoginPayload("hhb396013", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list = res.resultdata;
        return list;
      } else {
        return [];
      }
    },
    // 获取机构树
    async getOrgsTree({ rootGetters, state, commit }, params = {}) {
      // use804021
      const payload = getLoginPayload("use805025", {
        menuId: getMenuID(),
        userId: rootGetters.userInfo.userid,
        systemID: rootGetters.currentSystemID,
        ...params
      });
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        return res.resultdata.Tree;
      } else {
        return [];
      }
    },
    // 获取机构专属业务员use804030-采购专员
    async getOrgSalemanData({ rootGetters, state }, params = {}) {
      params = {
        menuId: getMenuID(),
        systemID: rootGetters.currentSystemID,
        pages: 1,
        rows: 100,
        ...params
      };
      // use804022
      const payload = getLoginPayload("use804030", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const datas = res.resultdata;
        const list =
          datas &&
          datas.map(item => {
            return {
              // 运营经理使用的，后台需要这个字段当作userCode
              userName: item.UserName,
              id: item.ID,
              name: item.RealName,
              MobliePhone: item.MobliePhone
            };
          });
        return list;
      } else {
        return [];
      }
    },
    // 获取经理人列表
    async getManageData({ rootGetters, state }, params = {}) {
      params = {
        menuId: getMenuID(),
        // userId: rootGetters.userInfo.userid,
        systemID: rootGetters.currentSystemID,
        pages: 1,
        rows: 100,
        ...params
      };
      // use804022
      const payload = getLoginPayload("xyh100107", { ...params });
      const res = await HttpServices.startApiReq(payload);
      return res.resultdata;
    },
    // 获取审批表格
    async examineTable({ rootGetters, state }, params = {}) {
      state.pageLoading = true;
      const payload = getLoginPayload("hhw428092", { ...params });
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        state.pageLoading = false;
        return res.resultdata;
      }
    },
    // 查询是否有审批金额submitExamine
    async searchExamineMoney({ rootGetters, state }, params = {}) {
      state.pageLoading = true;
      const payload = getLoginPayload("hhw428016", { ...params });
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        state.pageLoading = false;
        return res.resultdata;
      }
    },
    // 查询字典类型 枚举值
    async getDictTypeList({ rootGetters, state }, params = {}) {
      state.pageLoading = true;
      const payload = getLoginPayload("hhe221012", { ...params });
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        state.pageLoading = false;
        return res;
      }
    },
    // 提交审批
    async submitExamine({ rootGetters, state }, params = {}) {
      state.pageLoading = true;
      const payload = getLoginPayload("hhw428031", { ...params });
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        state.pageLoading = false;
        return res;
      }
    },
    // 支付回执单数据
    async receiptInit({ rootGetters, state }, params) {
      state.pageLoading = true;
      const payload = getLoginPayload("hhb925092", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        state.pageLoading = false;
        return res;
      }
    },
    // 汉集采 掉接口判断是否配置了机构权限
    async getOrgSet({ dispatch, commit }, params) {
      // 修改subTable列表
      const res = await HttpServices.startApiReq(
        getLoginPayload("hhb890011", {})
      );
      return res;
    },
    // 网价规格
    async priceSpecifications({ rootGetters, state }, params) {
      const payload = getLoginPayload("hhd281003", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode === 1) {
        const list = [];
        res.resultdata.map(item => {
          list.push({
            ...item,
            name: item.standard
          });
        });
        return list;
      }
    },
    // 机构从用户中心组织机构中获取（PS：运营系统不需要做数据权限，获取所有的 use804123
    async getOrgAll({ dispatch, commit }, params) {
      // 修改subTable列表
      let body = {
        systemID: 8888,
        ...params
      };
      const res = await HttpServices.startApiReq(
        getLoginPayload("use804123", body)
      );
      if (res.msgcode == 1) {
        return res.resultdata;
      }
    },
    // 获取供应商
    async getSuppliers({ state, commit, rootGetters }, params) {
      let body = {
        pages: 1,
        rows: 100,
        ...params
      };
      const payload = getLoginPayload("hhe829012", params);
      const res = await HttpServices.startApiReq(payload);
      if (res.msgcode == 1) {
        if(params.getTotal){
          return res.resultdata;
        }else {
          return res.resultdata.data;
        }
      } else {
        return [];
      }
    },
  }
};
